package com.jk.tweetsnear;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.jk.tweetsnear.utils.Utils;

public class Intro extends Activity
{

	public final String TAG = getClass().getSimpleName() + Utils.TAG_OPTION;
	
	//private TextView txtRandom;
	
	private String[] arrTxtRandom;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.intro);

		setWidjet();
		//setRandomString();
	}
	
	private void setRandomString()
	{
		arrTxtRandom = new String[5];
		int random = 0;
		
		arrTxtRandom[0] = getString(R.string.random_str_0);
		arrTxtRandom[1] = getString(R.string.random_str_1);
		arrTxtRandom[2] = getString(R.string.random_str_2);
		arrTxtRandom[3] = getString(R.string.random_str_3);
		arrTxtRandom[4] = getString(R.string.random_str_4);
		
		random = (int) (Math.random() * arrTxtRandom.length);
		
		if (Utils.DEBUG)
			Log.v(Utils.FILLTER, TAG + "intro random : " + random);
		
		//txtRandom.setText(arrTxtRandom[random]);
	}

	private void setWidjet()
	{
		//txtRandom = (TextView) findViewById(R.id.txt_intro);
		
		new Thread(new Runnable()
		{
			public void run()
			{
				try
				{
					Thread.sleep(3500);
				} catch (Throwable ex)
				{
					ex.printStackTrace();
				}
				Intent i = new Intent(Intro.this, MainMenuActivity.class);
				startActivity(i);
				finish();
			}
		}).start();
	}

	@Override
	protected void onPause()
	{
		super.onPause();
		if (Utils.DEBUG)
			Log.v(Utils.FILLTER, TAG + "onPause...");
	}

}
